<?php

require_once 'Zend/Db/Table/Abstract.php';

/**
 * Columns Table
 */
class Default_Model_Columns extends Zend_Db_Table_Abstract
{
    protected $_mapper;

    public function setMapper($mapper)
    {
        $this->_mapper = $mapper;
        return $this;
    }

    public function getMapper()
    {
        if (null === $this->_mapper) {
            $this->setMapper(new Default_Model_ColumnsMapper());
        }
        return $this->_mapper;
    }

    /**
     * Return list of columns from table.
     * This list is formated for extjs treePanel
     * 
     * @param string $tableName
     * @return array
     */
    public function getAllColumnsFromTable($tableName)
    {
        /**
         * Get columns list from mapper
         */
        $columns = $this->getMapper()->getAllColumnsFromTable($tableName);

        return $columns;
    }
    
}

